tak is package{

  tak(x,y,z) where y<x is tak(tak(x-1,y,z),tak(y-1,z,x),tak(z-1,x,y));
  tak(x,y,z) default is y;
  
  private One is unwrapInt(1);
  
  takI(x,y,z) where __integer_lt(y,x) is takI(takI(__integer_minus(x,One),y,z),takI(__integer_minus(y,One),z,x),takI(__integer_minus(z,One),x,y));
  takI(x,y,z) default is y;
  
  takk(integer(x),integer(y),integer(z)) is integer(takI(x,y,z));
  
  private unwrapInt(integer(I)) is I;
  
 
  main() do {
     St is nanos();
     -- R is tak(18,12,6);
     R is takk(19,13,5);
     -- R is tak(19,13,5);
     Tm is nanos()-St;
     
     logMsg(info,"tak(18,12,6) is $R");
     logMsg(info,"took $(Tm) nanoseconds");
     assert R=19;
  }
}